package com.ysd.dao.impl;


import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;




import com.ysd.entity.Producttype;
import com.ysd.util.DBManage;


public class ProduoctlistDao {
	public static ArrayList<Producttype> getAll() {
		
		ArrayList<Producttype> list =new ArrayList<Producttype>();
			try {
				Connection conn = DBManage.getConn();
				Statement stam = conn.createStatement();
				String sql="select id,productTypeName from producttype";
				ResultSet rs=stam.executeQuery(sql);
				while(rs.next()) {
					Producttype u=new Producttype(rs.getInt("id"),rs.getString("ProductTypeName"));
					list.add(u);
				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return list;
			
	}

}
